13. Chain Rule & Implicit Differentiation
b. Chain Rule
2. Nested Chain Rules
Compositions may be nested and we may need to apply the Chain Rule repeatedly. While doing the derivative, we rarely specifically identify the inner and outer functions and separately write down their derivatives. Rather, we start with the outermost function and work inward. The outermost function is the last operation you would perform if you plugged in a number to evaluate the function.
Compute the derivative of \(f(x)=\sin^3(4x^3-\cos(x^2))\).
The outermost function is \(\text{stuff}^{\;3}\) where \(\text{stuff}\) is \(\sin(4x^3-\cos(x^2))\). The derivative of \(\text{stuff}^{\;3}\) is \(3\,\text{stuff}^{\;2}\) but then we need to multiply by the derivative of the \(\text{stuff}\): \[ \dfrac{df}{dx}=3\sin^2(4x^3-\cos(x^2))\dfrac{d}{dx}\sin(4x^3-\cos(x^2)) \] Now we look at \(\sin(\text{morestuff})\) where \(\text{morestuff}=4x^3-\cos(x^2)\). The derivative of \(\sin(\text{morestuff})\) is \(\cos(\text{morestuff})\) but then we multiply by the derivative of \(\text{morestuff}\): \[\begin{aligned} \dfrac{df}{dx} &=3\sin^2(4x^3-\cos(x^2))\cos(4x^3-\cos(x^2)) \\ &\quad\cdot\dfrac{d}{dx}(4x^3-\cos(x^2)) \end{aligned}\] \(4x^3-\cos(x^2)\) is a sum. So we differentiate each term. The derivative of the first term \(4x^3\) is \(12x^2\) and the derivative of the second term \(-\cos(x^2)\) is \(\sin(x^2)2x\) again using the Chain Rule. Putting it all together, we have: \[\begin{aligned} \dfrac{df}{dx} &=3\sin^2(4x^3-\cos(x^2))\cos(4x^3-\cos(x^2)) \\ &\quad\cdot(12x^2+\sin(x^2)2x) \end{aligned}\]
Usually, the identification of \(\text{stuff}\) and \(\text{morestuff}\) is done in the head and not written down separately but the intermediate lines are still useful in the computation, as in this example:
Compute \(\dfrac{d}{dx}\left[\sin^2(x+x^2)\cos(3x+2)\rule{0pt}{10pt}\right]\).
The outermost function is multiplication. So we start with the Product Rule: \[\begin{aligned} \dfrac{d}{dx}&\left[\sin^2(x+x^2)\cos(3x+2)\rule{0pt}{10pt}\right] \\ &=\left[\dfrac{d}{dx}\sin^2(x+x^2)\right]\cos(3x+2) \\ &\quad+\sin^2(x+x^2)\left[\dfrac{d}{dx}\cos(3x+2)\right] \end{aligned}\] The remaining two derivatives are Chain Rules. The first has an outer function which is \(\text{stuff}^{\;2}\). The second is \(\cos(\text{morestuff})\): \[\begin{aligned} \dfrac{d}{dx}&\left[\sin^2(x+x^2)\cos(3x+2)\rule{0pt}{10pt}\right] \\ &=\left[2\sin(x+x^2)\dfrac{d}{dx}\sin(x+x^2)\right]\cos(3x+2) \\ &\quad+\sin^2(x+x^2)\left[-\sin(3x+2)\dfrac{d}{dx}(3x+2)\right] \end{aligned}\] We finish up with another Chain Rule and two polynomial derivatives. Finally, we simplify: \[\begin{aligned} \dfrac{d}{dx}&\left[\sin^2(x+x^2)\cos(3x+2)\rule{0pt}{10pt}\right] \\ &=\left[2\sin(x+x^2)\cos(x+x^2)(1+2x)\right]\cos(3x+2) \\ &\quad+\sin^2(x+x^2)\left[-\sin(3x+2)(3)\right] \\ &=2(1+2x)\sin(x+x^2)\cos(x+x^2)\cos(3x+2) \\ &\quad-3\sin^2(x+x^2)\sin(3x+2) \end{aligned}\]
Compute \(\dfrac{d}{dx}\left[e^{x^2}-5e^{3x}\rule{0pt}{10pt}\right]\).
\(\dfrac{d}{dx}\left[e^{x^2}-5e^{3x}\rule{0pt}{10pt}\right] =2xe^{x^2}-15e^{3x}\)
We use the Sum Rule followed by the Exponential and Chain Rules twice: \[\begin{aligned} \dfrac{d}{dx}&\left[e^{x^2}-5e^{3x}\rule{0pt}{10pt}\right] =\dfrac{d}{dx}e^{x^2}-5\dfrac{d}{dx}e^{3x} \\ &=e^{x^2}(2x)-5e^{3x}(3) =2xe^{x^2}-15e^{3x} \end{aligned}\]
Heading
Placeholder text: Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum